const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    prompt:"14",
    point:"28888",
    list:[{
      name:'签到',
      time:'2019-12-30',
      point:'1'
    }, {
        name: '签到',
        time: '2019-12-30',
        point: '1'
      }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    wx.getStorage({
      key: 'openid',
      success: function(res) {
        let openid = res.data

        wx.request({
          url: app.globalData.URL + '/app/withdraw/userbalance?openid=' + openid,
          success: function (res) {
            console.log(res)
            that.setData({
              point: res.data.jifen,
              prompt: res.data.cha,
              list: res.data.list
            })
          }
        })
      },
    })
    
  },


  pointRule:function(){
    wx.navigateTo({
      url: '../pointRule/pointRule',
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  }
})